/**      
 * @file		average.cpp
 * @description		This application demonstrates how to treat 
 *			standard input as a file. File have a special
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author	    	Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	int number		= 0;
	int sum			= 0;
	int count		= 0;

	cout << "Please type a few integers to average.\n";
	cout << "You may terminate the input process by typing ";
	cout << "control+z on windows or control+d on linux.\n";
	
	// you can terminate this loop by 
	// using the key strokes control+Z
	while(cin >> number)  {
		sum = number + sum;
		count++;
	}
	
	cout << "The average is " << static_cast<double>(sum)/count << endl;
	return 0;
}
